package TreeMap;

import java.util.TreeMap;

public class demo2 {
    public static void main(String[] args) {
        Student s1 = new Student("zhangsan", 18);
        Student s2 = new Student("lisi", 17);
        Student s3 = new Student("wangwu", 20);
        TreeMap<Student, String> tm = new TreeMap<>();
        tm.put(s1, "湖北省");
        tm.put(s3, "广东省");
        tm.put(s2, "江苏省");
        //要求: 按照学生的年龄排序,年龄一样按照姓名和字母排序,同姓名和年龄视为同一个人
        System.out.println(tm);


    }
}
